Question: Let $a$ and $b$ be real numbers such that $a + 4i$ and $b + 5i$ are the roots of
\[z^2 - (10 + 9i) z + (4 + 46i) = 0.\]Enter the ordered pair $(a,b).$
Solution: By Vieta's formulas,
\begin{align*}
(a + 4i) + (b + 5i) &= 10 + 9i, \\
(a + 4i)(b + 5i) &= 4 + 46i.
\end{align*}From the first equation, $a + b + 9i = 10 + 9i,$ so $a + b = 10.$

Expanding the second equation, we get
\[(ab - 20) + (5a + 4b)i = 4 + 46i.\]Hence, $ab = 24$ and $5a + 4b = 46.$

Solving $a + b = 10$ and $5a + 4b = 46,$ we find $a = 6$ and $b = 4.$  (Note that these values satisfy $ab = 24.$)  Therefore, $(a,b) = \boxed{(6,4)}.$